home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / StandardFile.a < prev    next >
Encoding:
Text File  |  1996-01-24  |  7.1 KB  |  257 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        StandardFile.a
  3. ;
  4. ;    Contains:    Standard File package Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__STANDARDFILE__') = 'UNDEFINED' THEN
  21. __STANDARDFILE__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  30.     include 'Dialogs.a'
  31.     ENDIF
  32. ;        include 'Errors.a'                                            ;
  33. ;        include 'Memory.a'                                            ;
  34. ;            include 'MixedMode.a'                                    ;
  35. ;        include 'Menus.a'                                            ;
  36. ;            include 'Quickdraw.a'                                    ;
  37. ;                include 'QuickdrawText.a'                            ;
  38. ;        include 'Controls.a'                                        ;
  39. ;        include 'Windows.a'                                        ;
  40. ;            include 'Events.a'                                        ;
  41. ;                include 'OSUtils.a'                                ;
  42. ;        include 'TextEdit.a'                                        ;
  43.  
  44.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  45.     include 'Files.a'
  46.     ENDIF
  47. ;        include 'Finder.a'                                            ;
  48.  
  49. ; resource IDs and item offsets of pre-7.0 dialogs 
  50. putDlgID                        EQU        -3999
  51. putSave                            EQU        1
  52. putCancel                        EQU        2
  53. putEject                        EQU        5
  54. putDrive                        EQU        6
  55. putName                            EQU        7
  56. getDlgID                        EQU        -4000
  57. getOpen                            EQU        1
  58. getCancel                        EQU        3
  59. getEject                        EQU        5
  60. getDrive                        EQU        6
  61. getNmList                        EQU        7
  62. getScroll                        EQU        8
  63. ; resource IDs and item offsets of 7.0 dialogs 
  64. sfPutDialogID                    EQU        -6043
  65. sfGetDialogID                    EQU        -6042
  66. sfItemOpenButton                EQU        1
  67. sfItemCancelButton                EQU        2
  68. sfItemBalloonHelp                EQU        3
  69. sfItemVolumeUser                EQU        4
  70. sfItemEjectButton                EQU        5
  71.  
  72. sfItemDesktopButton                EQU        6
  73. sfItemFileListUser                EQU        7
  74. sfItemPopUpMenuUser                EQU        8
  75. sfItemDividerLinePict            EQU        9
  76. sfItemFileNameTextEdit            EQU        10
  77. sfItemPromptStaticText            EQU        11
  78. sfItemNewFolderUser                EQU        12
  79. ; pseudo-item hits for use in DlgHook 
  80. sfHookFirstCall                    EQU        -1
  81. sfHookCharOffset                EQU        $1000
  82. sfHookNullEvent                    EQU        100
  83. sfHookRebuildList                EQU        101
  84. sfHookFolderPopUp                EQU        102
  85. sfHookOpenFolder                EQU        103
  86. ; the following are only in system 7.0+ 
  87. sfHookOpenAlias                    EQU        104
  88. sfHookGoToDesktop                EQU        105
  89. sfHookGoToAliasTarget            EQU        106
  90. sfHookGoToParent                EQU        107
  91. sfHookGoToNextDrive                EQU        108
  92. sfHookGoToPrevDrive                EQU        109
  93. sfHookChangeSelection            EQU        110
  94.  
  95. sfHookSetActiveOffset            EQU        200
  96. sfHookLastCall                    EQU        -2
  97.  
  98. ; the refcon field of the dialog record during a
  99. ; modalfilter or dialoghook contains one of the following 
  100. sfMainDialogRefCon                EQU        'stdf'
  101. sfNewFolderDialogRefCon            EQU        'nfdr'
  102. sfReplaceDialogRefCon            EQU        'rplc'
  103. sfStatWarnDialogRefCon            EQU        'stat'
  104. sfLockWarnDialogRefCon            EQU        'lock'
  105. sfErrorDialogRefCon                EQU        'err '
  106.  
  107. SFReply                 RECORD    0
  108. good                     ds.b   1        ; offset: $0 (0)
  109. copy                     ds.b   1        ; offset: $1 (1)
  110. fType                     ds.l   1        ; offset: $2 (2)
  111. vRefNum                     ds.w   1        ; offset: $6 (6)
  112. version                     ds.w   1        ; offset: $8 (8)
  113. fName                     ds.l   16        ; offset: $A (10)
  114. sizeof                     EQU *            ; size:   $4A (74)
  115.                         ENDR
  116.  
  117. ; typedef struct SFReply     SFReply
  118. StandardFileReply         RECORD    0
  119. sfGood                     ds.b   1        ; offset: $0 (0)
  120. sfReplacing                 ds.b   1        ; offset: $1 (1)
  121. sfType                     ds.l   1        ; offset: $2 (2)
  122. sfFile                     ds     FSSpec    ; offset: $6 (6)
  123. sfScript                 ds.w   1        ; offset: $4C (76)
  124. sfFlags                     ds.w   1        ; offset: $4E (78)
  125. sfIsFolder                 ds.b   1        ; offset: $50 (80)
  126. sfIsVolume                 ds.b   1        ; offset: $51 (81)
  127. sfReserved1                 ds.l   1        ; offset: $52 (82)
  128. sfReserved2                 ds.w   1        ; offset: $56 (86)
  129. sizeof                     EQU *            ; size:   $58 (88)
  130.                         ENDR
  131.  
  132. ; typedef struct StandardFileReply  StandardFileReply
  133. ; for CustomXXXFile, ActivationOrderListPtr parameter is a pointer to an array of item numbers 
  134. ; typedef const short         *ActivationOrderListPtr
  135. ; the following also include an extra parameter of "your data pointer" 
  136. ; typedef OSType             SFTypeList[4]
  137. ;
  138. ;    The GetFile "typeList" parameter type has changed from "SFTypeList" to "ConstSFTypeListPtr".
  139. ;    For C, this will add "const" and make it an in-only parameter.
  140. ;    For Pascal, this will require client code to use the @ operator, but make it easier to specify long lists.
  141. ;
  142. ;    ConstSFTypeListPtr is a pointer to an array of OSTypes.
  143. ;
  144. ; typedef const OSType         *ConstSFTypeListPtr
  145. ;
  146. ; pascal void SFPutFile(Point where, ConstStr255Param prompt, ConstStr255Param origName, DlgHookUPP dlgHook, SFReply *reply)
  147. ;
  148.     IF ¬ GENERATINGCFM THEN
  149.         Macro
  150.         _SFPutFile
  151.             move.w    #$0001,-(sp)
  152.             dc.w     $A9EA
  153.         EndM
  154.     ELSE
  155.         IMPORT_CFM_FUNCTION    SFPutFile
  156.     ENDIF
  157.  
  158. ;
  159. ; pascal void SFGetFile(Point where, ConstStr255Param prompt, FileFilterUPP fileFilter, short numTypes, ConstSFTypeListPtr typeList, DlgHookUPP dlgHook, SFReply *reply)
  160. ;
  161.     IF ¬ GENERATINGCFM THEN
  162.         Macro
  163.         _SFGetFile
  164.             move.w    #$0002,-(sp)
  165.             dc.w     $A9EA
  166.         EndM
  167.     ELSE
  168.         IMPORT_CFM_FUNCTION    SFGetFile
  169.     ENDIF
  170.  
  171. ;
  172. ; pascal void SFPPutFile(Point where, ConstStr255Param prompt, ConstStr255Param origName, DlgHookUPP dlgHook, SFReply *reply, short dlgID, ModalFilterUPP filterProc)
  173. ;
  174.     IF ¬ GENERATINGCFM THEN
  175.         Macro
  176.         _SFPPutFile
  177.             move.w    #$0003,-(sp)
  178.             dc.w     $A9EA
  179.         EndM
  180.     ELSE
  181.         IMPORT_CFM_FUNCTION    SFPPutFile
  182.     ENDIF
  183.  
  184. ;
  185. ; pascal void SFPGetFile(Point where, ConstStr255Param prompt, FileFilterUPP fileFilter, short numTypes, ConstSFTypeListPtr typeList, DlgHookUPP dlgHook, SFReply *reply, short dlgID, ModalFilterUPP filterProc)
  186. ;
  187.     IF ¬ GENERATINGCFM THEN
  188.         Macro
  189.         _SFPGetFile
  190.             move.w    #$0004,-(sp)
  191.             dc.w     $A9EA
  192.         EndM
  193.     ELSE
  194.         IMPORT_CFM_FUNCTION    SFPGetFile
  195.     ENDIF
  196.  
  197. ;
  198. ; pascal void StandardPutFile(ConstStr255Param prompt, ConstStr255Param defaultName, StandardFileReply *reply)
  199. ;
  200.     IF ¬ GENERATINGCFM THEN
  201.         Macro
  202.         _StandardPutFile
  203.             move.w    #$0005,-(sp)
  204.             dc.w     $A9EA
  205.         EndM
  206.     ELSE
  207.         IMPORT_CFM_FUNCTION    StandardPutFile
  208.     ENDIF
  209.  
  210. ;
  211. ; pascal void StandardGetFile(FileFilterUPP fileFilter, short numTypes, ConstSFTypeListPtr typeList, StandardFileReply *reply)
  212. ;
  213.     IF ¬ GENERATINGCFM THEN
  214.         Macro
  215.         _StandardGetFile
  216.             move.w    #$0006,-(sp)
  217.             dc.w     $A9EA
  218.         EndM
  219.     ELSE
  220.         IMPORT_CFM_FUNCTION    StandardGetFile
  221.     ENDIF
  222.  
  223. ;
  224. ; pascal void CustomPutFile(ConstStr255Param prompt, ConstStr255Param defaultName, StandardFileReply *reply, short dlgID, Point where, DlgHookYDUPP dlgHook, ModalFilterYDUPP filterProc, ActivationOrderListPtr activeList, ActivateYDUPP activate, void *yourDataPtr)
  225. ;
  226.     IF ¬ GENERATINGCFM THEN
  227.         Macro
  228.         _CustomPutFile
  229.             move.w    #$0007,-(sp)
  230.             dc.w     $A9EA
  231.         EndM
  232.     ELSE
  233.         IMPORT_CFM_FUNCTION    CustomPutFile
  234.     ENDIF
  235.  
  236. ;
  237. ; pascal void CustomGetFile(FileFilterYDUPP fileFilter, short numTypes, ConstSFTypeListPtr typeList, StandardFileReply *reply, short dlgID, Point where, DlgHookYDUPP dlgHook, ModalFilterYDUPP filterProc, ActivationOrderListPtr activeList, ActivateYDUPP activate, void *yourDataPtr)
  238. ;
  239.     IF ¬ GENERATINGCFM THEN
  240.         Macro
  241.         _CustomGetFile
  242.             move.w    #$0008,-(sp)
  243.             dc.w     $A9EA
  244.         EndM
  245.     ELSE
  246.         IMPORT_CFM_FUNCTION    CustomGetFile
  247.     ENDIF
  248.  
  249. ;
  250. ; pascal OSErr StandardOpenDialog(StandardFileReply *reply)
  251. ;
  252.     IF GENERATINGCFM THEN
  253.         IMPORT_CFM_FUNCTION    StandardOpenDialog
  254.     ENDIF
  255.  
  256.     ENDIF ; __STANDARDFILE__
  257.